/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-08-18
 * Time: 14:27
 */
public class MyBinaryTreeTest {
    public static void main2(String[] args) {
        MyBinaryTree tree = new MyBinaryTree();
        MyBinaryTree.TreeNode root =tree.creatTree1();
        tree.preOrder(root);
    }
    public static void main(String[] args) {
        MyBinaryTree tree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = tree.creatTree();
        System.out.println("前序:");
        tree.preOrder(root);
        System.out.println();
        System.out.println("中序遍历:");
        tree.inOrder(root);
        System.out.println();
        System.out.println("后序遍历:");
        tree.postOrder(root);
        System.out.println("节点的个数:"+ tree.size(root));
        tree.size2(root);
        System.out.println("节点的个数:"+MyBinaryTree.nodeSize);
        System.out.println("获取叶子节点个数"+tree.getLeafNodeCount(root));
        tree.getLeafNodeCount2(root);
        System.out.println("获取叶子节点个数:"+ MyBinaryTree.leafsize);
        System.out.println(tree.getKLevelNodeCount(root, 4));
        int n = tree.getHeight(root);
        System.out.println("树的高度:"+ n);
        MyBinaryTree.TreeNode node = tree.find(root,'E');
        System.out.println("查找:"+node.val);
        tree.levelOrder(root);
        System.out.println();
        System.out.println("是完全二叉树吗:"+tree.isCompleteTree(root));////E.right = H; true

    }
}
